|
Week 2 - Blink Using OS
|
Data Structures | |
| struct | led_blink_s |
Macros | |
| #define | BLINK_TASK_STACK_SIZE (OS_TASK_IDLE_STK_SIZE+0) |
| #define | YELLOW_FREQ (2 * MILLI_HZ_PER_HZ) |
| #define | BLUE_RED_FREQ (1 * MILLI_HZ_PER_HZ) |
| #define | RED_START_DELAY ((BLUE_RED_FREQ * OS_TICKS_PER_SEC) / (2 * MILLI_HZ_PER_HZ)) |
Typedefs | |
| typedef enum LED_POS_ENUM | led_t |
| typedef struct led_blink_s | led_data_t |
Enumerations | |
| enum | LED_POS_ENUM { RED_LED, GREEN_LED, BLUE_LED, YELLOW_LED } |
Functions | |
| void | blink_task (void *ptr) |
| void | start_blinking (void) |
| int | main (void) |
Variables | |
| static led_data_t | blue_config |
| static led_data_t | red_config |
| static led_data_t | yellow_config |
| static OS_STK | blue_task_stk [BLINK_TASK_STACK_SIZE] |
| static OS_STK | red_task_stk [BLINK_TASK_STACK_SIZE] |
| static OS_STK | yellow_task_stk [BLINK_TASK_STACK_SIZE] |
Application which blinks the color LED alternating Red/Blue at 1 Hz and blinks the Yellow LED at 2 Hz.
| #define BLINK_TASK_STACK_SIZE (OS_TASK_IDLE_STK_SIZE+0) |
Stack size in stk_size elements
Definition at line 25 of file blink_task.c.
| #define BLUE_RED_FREQ (1 * MILLI_HZ_PER_HZ) |
Blue/Red LED blinks at 1 Hz
Definition at line 34 of file blink_task.c.
| #define RED_START_DELAY ((BLUE_RED_FREQ * OS_TICKS_PER_SEC) / (2 * MILLI_HZ_PER_HZ)) |
To get the Red LED to alternate with the Blue LED we delay its start until halfway through the Blue/Red blink cycle.
Definition at line 38 of file blink_task.c.
| #define YELLOW_FREQ (2 * MILLI_HZ_PER_HZ) |
Yellow LED blinks at 2 Hz
Definition at line 33 of file blink_task.c.
Structure which defines to blink_task() the LED to blink and the frequency to blink it at. Based on led_blink_s
Enumerated type that allows generic selection of LEDs on the Launchpad or Boost board by LED color. See LED_POS_ENUM for more information.
| enum LED_POS_ENUM |
| void blink_task | ( | void * | parms | ) |
Task to blink an LED at a given rate param parms is expected to point to a structure of type led_data_t which contains the parameters used by the task. This function assumes that the parameters are in a static structure.
| parms | Pointer to a structure of led_data_t which contains the parameters used by the task. This function assumes that the parameters are in a static structure |
Definition at line 95 of file blink_task.c.
| int main | ( | void | ) |
| void start_blinking | ( | void | ) |
Function which starts the blink tasks
Definition at line 164 of file blink_task.c.

|
static |
led_data_t structure defining how the blue led will blink.
Definition at line 53 of file blink_task.c.
|
static |
Kernel stack for the blue led instance of blink_task.
Definition at line 81 of file blink_task.c.
|
static |
led_data_t structure defining how the red led will blink.
Definition at line 58 of file blink_task.c.
|
static |
Kernel stack for the red counter point led instance of blink_task.
Definition at line 82 of file blink_task.c.
|
static |
led_data_t structure defining how the yellow led will blink.
Definition at line 63 of file blink_task.c.
|
static |
Kernel stack for the yellow led instance of blink_task.
Definition at line 83 of file blink_task.c.
1.8.9.1